#ifndef __READER_H__
#define __READER_H__

#include <boost/asio.hpp>

using boost::asio::serial_port_base;

class AsyncSerial: private boost::noncopyable {
	
	public:
		AsyncSerial();
		virtual ~AsyncSerial() {}
		
		AsyncSerial( const std::string& device, unsigned int baudrate,
			parity opt_parity = parity( parity::none ),
			character_size opt_csize = character_size( 8 ), 
			flow_control opt_flow = flow_control( flow_control::none ),
			stop_bits opt_stop = stop_bits( stop_bits::one ));
		
		void Open( const std::string& device, unsigned int baudrate,
			parity opt_parity = parity( parity::none ),
			character_size opt_csize = character_size( 8 ), 
			flow_control opt_flow = flow_control( flow_control::none ),
			stop_bits opt_stop = stop_bits( stop_bits::one ));

		bool IsOpen() const;
		bool ErrorStatus() const;
		void Close();
		void Write( const char *data, size_t size );
		void Write( const std::vector<char>& data );
		void WriteString( const std::string& s );
};

class Reader : public AsyncSerial {
};

#endif
